package com.clear.prototype.shallowcopy.constructor;

import com.clear.prototype.shallowcopy.Song;
import lombok.extern.slf4j.Slf4j;

/**
 * 测试浅拷贝
 */
@Slf4j
public class Main {
    public static void main(String[] args) {
        Playlist playlist = new Playlist();
        playlist.setId(1L);
        playlist.setName("杰伦");
        playlist.add(new Song("稻香","杰伦"));
        playlist.add(new Song("迷迭香","杰伦"));
        playlist.add(new Song("七里香","杰伦"));

        // 浅拷贝后的最喜爱的专辑
        Playlist favouriteList = new Playlist(playlist);
        favouriteList.add(new Song("曹操","林俊杰"));
        log.info("favouriteList:{}",favouriteList);
    }
}
